package chapter02

class Student(name: String, var age: Int) {
  //def关键字 定义方法
  def printInfo(): Unit = {
    println(name + "," + age + "," + Student.school)
  }
}


object Student {
  val school: String = "Xinghua"

  def main(args: Array[String]): Unit = {
    val yjn = new Student("yjn", 18)
    //如果在Student的class中写了var,那么该参数就是成员变量
    yjn.age = 19
    yjn.printInfo()
    var `try`: String = "abc"
  }
}